@extends('layouts.template')

@section('title', '管理后台')

@section('content')

    <script>
        var selectedMenu = 'merchant/all';
        var selectedTitle = '货品仓库';

        $(function(){

            var form = new Vue({
                el:'#contentpanel',
                data:{
                },
                computed:{
                },
                mounted:function(){
                },
                watch: {
                },
                methods:{
                },
                components:{
                }
            });

            window.showImage = function(source)
            {
                $("#image").find(".modal-content").html("<image src='"+source+"' width='100%' />");
                $("#image").modal('show');
            }

        });

    </script>

    <div class="contentpanel" id="contentpanel">

        <div class="row">
            <div class="col-md-12">
                <div class="table-responsive">
                    <table class="table mb30">
                        <thead>
                        <tr style="white-space:nowrap">
                            <th>用户名</th>
                            <th>货品类目</th>
                            <th>货品名称</th>
                            <th>上传时间</th>
                            <th>货品图片</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php foreach ($list as $row):?>
                            <tr data-id="{{$row->go_id}}">
                                <td>{{$row->merchant->me_username}}</td>
                                <td>{{$row->type_text}}</td>
                                <td>{{$row->go_name}}</td>
                                <td>{{$row->go_add_time}}</td>
                                <td><button onclick="showImage('{{$row->img_url}}')" class="btn btn-white">查看</button></td>
                                <td>
                                    {{--<a href="{{url("merchant/editgoods/{$row->go_id}")}}" class="btn btn-white">编辑</a>--}}
                                    <a onclick="return confirm('确定')" href="{{url("merchant/delgoods/{$row->go_id}")}}" class="btn btn-danger">删除</a>
                                </td>
                            </tr>
                        <?php endforeach;?>
                        </tbody>
                    </table>
                </div>
                <!-- table-responsive -->
                {{ @!$list->isEmpty() ? $list->appends(request()->all())->links() : '' }}
            </div>
            <!-- col-md-12 -->
        </div>
    </div><!-- contentpanel -->

    <div class="modal fade" id="image" tabindex="-1" role="dialog" data-keyboard="false">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
            </div>
        </div>
    </div>

@endsection

